package org.example.test1;

public class Book1 {
    private String title;
    private int pageNum;

    public void detail(){
        System.out.println("titie:"+this.title+"\tpageNum:"+this.pageNum);
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        if (pageNum < 200) {
            System.out.println("error");
            this.pageNum = 200;
        }else this.pageNum = pageNum;
    }

    public Book1(String title) {
        this.title = title;
    }

    public Book1(int pageNum) {
        this.pageNum = pageNum;
    }

    public Book1(String title, int pageNum) {
        this.title = title;
        this.pageNum = pageNum;
    }
    public Book1(){}
}
